home *** CD-ROM | disk | FTP | other *** search
- global gfudgefactor, gPicList, gAutoInterval, gAutoDelay, gQuitDelay, gDemoState, gPicNumList, gPicSpriteList, gWhatTimeIsIt, gSndList, gColorDepth, gFinalExit
-
- on startMovie
- spriteVisibility(1, 48, 1)
- ResetDemo()
- set whatsndfolder to "zoomsnd"
- if the machineType = 256 then
- set fileSep to "/"
- else
- set fileSep to ":"
- end if
- set the volume of sound 1 to 255
- set the volume of sound 2 to 255
- set gAutoInterval to 5 * 60
- set gAutoDelay to 180 * 60
- set gQuitDelay to 180 * 60
- if the machineType = 256 then
- checkPrefFile("zbnipref.txt", "zoombini.exe", "begin", "Wait")
- end if
- checkMonitor("start")
- set the exitLock to 1
- end
-
- on stopMovie
- spriteVisibility(1, 48, 1)
- checkMonitor("stop")
- XobjCleanup()
- clearGlobals()
- end
-
- on keyDown
- checkExit()
- end
-
- on checkExit
- if the keyCode = 53 then
- if gFinalExit <> "LastRoundUp" then
- setUpPuppets(1, 48, 0)
- MouseLock(1)
- set gFinalExit to "LastRoundUp"
- go("fadeOut")
- end if
- end if
- end
-
- on XobjCleanup
- if objectp(gFileObj) then
- gFileObj(mdispose)
- end if
- if objectp(gUtilObj) then
- gUtilObj(mdispose)
- end if
- end
-
- on checkMonitor whichState
- if whichState = "start" then
- if the colorDepth <> 8 then
- if the machineType = 256 then
- alert("This Demo requires that your monitor be set to 256 colors (8-bit). Please adjust your settings, restart Windows, and begin this demo again!")
- quit()
- else
- set gColorDepth to the colorDepth
- set the colorDepth to 8
- end if
- end if
- else
- if the machineType <> 256 then
- if gColorDepth <> EMPTY then
- set the colorDepth to gColorDepth
- end if
- end if
- end if
- end
-
- on ResetDemo
- set HowManyPics to 5
- set gPicNumList to []
- set gPicList to ["Island", "Allergic", "Caves", "Pizza", "Camp"]
- set gSndList to ["Zmb_100.aif", "Zmb_060.aif", "Zmb_070.aif", "Zmb_080.aif", "Zmb_090.aif"]
- set gPicSpriteList to [2, 3, 4, 5, 6]
- set totalPick to 0
- set gDemoState to "notDemo"
- spriteVisibility(1, 48, 1)
- repeat while totalPick < HowManyPics
- set NewNumber to random(HowManyPics)
- if getOne(gPicNumList, NewNumber) = 0 then
- add(gPicNumList, NewNumber)
- set totalPick to totalPick + 1
- end if
- end repeat
- end
-
- on setUpPuppets start, end, switch
- repeat with x = start to end
- puppetSprite(x, switch)
- end repeat
- end
-
- on spriteVisibility start, end, switch
- repeat with x = start to end
- set the visible of sprite x to switch
- end repeat
- end
-
- on checkRollover FirstSprite, LastSprite
- repeat with x = FirstSprite to LastSprite
- if rollOver(x) = 1 then
- set the visible of sprite x to 1
- next repeat
- end if
- set the visible of sprite x to 0
- end repeat
- end
-
- on ButtonHiLite
- set whichNumber to the castNum of sprite the clickOn
- if rollOver(the clickOn) = 1 then
- set the hilite of cast whichNumber to 1
- else
- set the hilite of cast whichNumber to 0
- end if
- end
-
- on CheckTheTimer
- if (gDemoState = "Demo") or (the timer > gAutoDelay) then
- startTheDemo()
- end if
- end
-
- on initGlobals
- set gDemoState to "notDemo"
- end
-
- on mouseUp
- if gDemoState = "Demo" then
- go("fadeOut")
- end if
- end
-
- on exitAutoRun
- dontPassEvent()
- initGlobals()
- ResetDemo()
- MouseLock(1)
- puppetSound(0)
- set listSize to count(gPicSpriteList)
- repeat with x = 1 to listSize
- set spriteNum to getAt(gPicSpriteList, x)
- setUpPuppets(spriteNum, spriteNum, 0)
- end repeat
- set the volume of sound 1 to 255
- set the volume of sound 2 to 255
- go("Begin")
- end
-
- on startTheDemo
- set gDemoState to "Demo"
- set the mouseDownScript to "exitAutoRun"
- set the mouseUpScript to "dontPassEvent"
- if the timer > gAutoInterval then
- if gPicNumList = [] then
- spriteVisibility(1, 48, 1)
- go("Leave")
- exit
- end if
- go("SwapPics")
- end if
- end
-
- on SwapThePic
- if gDemoState = "Demo" then
- set nextRanNum to getAt(gPicNumList, 1)
- set NextPicSprite to getAt(gPicSpriteList, nextRanNum)
- set nextPic to getAt(gPicList, nextRanNum)
- deleteAt(gPicNumList, 1)
- set nextSnd to getAt(gSndList, nextRanNum)
- else
- if getOne(gPicSpriteList, the clickOn) = 0 then
- exit
- end if
- set NextPicSprite to the clickOn
- set NextPicSpritePos to getOne(gPicSpriteList, NextPicSprite)
- set nextPic to getAt(gPicList, NextPicSpritePos)
- set nextSnd to getAt(gSndList, NextPicSpritePos)
- end if
- spriteVisibility(2, 6, 1)
- set NewCast to the number of cast (nextPic & "PIC")
- set the castNum of sprite NextPicSprite to NewCast
- put NewCast
- puppetSound(nextSnd)
- end
-
- on SkipAhead SkipToWhere
- puppetSound(0)
- unLoadCast()
- set the mouseDownScript to "DontPassEvent"
- set the mouseUpScript to "DontPassEvent"
- go(SkipToWhere)
- end
-
- on idle
- end
-
- on WaitHere howLong
- set startTime to the ticks
- set endTime to startTime + (howLong * 60)
- repeat while the ticks < endTime
- nothing()
- end repeat
- end
-
- on MouseLock LockState
- if gDemoState <> "Demo" then
- if LockState = 0 then
- set the mouseUpScript to EMPTY
- set the mouseDownScript to EMPTY
- else
- set the mouseUpScript to "DontPassEvent"
- set the mouseDownScript to "DontPassEvent"
- end if
- end if
- end
-
- on goToArno
- sound fadeOut 1, 2 * 60
- MouseLock(1)
- go("PleaseWait")
- end
-
- on changeSndVolume whichChannel, whichWay, newVol
- set currVol to the volume of sound whichChannel
- if whichWay = "minus" then
- repeat with volCount = currVol down to newVol
- set the volume of sound whichChannel to volCount
- end repeat
- else
- repeat with volCount = currVol to newVol
- set the volume of sound whichChannel to volCount
- end repeat
- end if
- end
-